package com.nursebetty.droid.client.activity;

import com.nursebetty.droid.client.model.User;
import com.nursebetty.droid.client.util.Util;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class Main extends Activity {
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.home);
        
        final User user = (User) getIntent().getSerializableExtra("user");
        
        
        Button weightBtn = (Button)findViewById(R.id.weightBtn);
        weightBtn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				Intent i = new Intent(Main.this, Weight.class);
				Bundle b = new Bundle();
				b.putSerializable("user", user);
				i.putExtras(b);
				
				startActivity(i);
				
			}
        	
        	
        });
        
        Button diabetesBtn = (Button)findViewById(R.id.diabetesBtn);
        diabetesBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent i = new Intent(Main.this, Glucoss.class);
				Bundle b = new Bundle();
				b.putSerializable("user", user);
				i.putExtras(b);
				
				startActivity(i);
				
			}
		});
        
        Button bloodBtn = (Button)findViewById(R.id.bloodBtn);
        bloodBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				
			}
		});

//        TextView greeting = (TextView)findViewById(R.id.Greeting);
//        greeting.setText("Welcome " + user.getName() + "!");
        
//        Bitmap bitmap = 
//            Util.DownloadImage(
//            "http://assets.devx.com/articlefigs/39810_2.jpg");
//        ImageView img = (ImageView) findViewById(R.id.UserImage);
//        img.setImageBitmap(bitmap);

        
	}

}
